<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:jq="http://www.jquery4jsf.org/jsf">
	<ui:define name="head">
		<jq:outputScript charset="utf-8" type="text/javascript"
			src="#{facesContext.externalContext.requestContextPath}/jquery4jsf_resource/external/jquery.cookie.js" />
		<jq:outputScript charset="utf-8" type="text/javascript">
				//<![CDATA[
				function initMenu() {
					 jQuery('#menuLeft .BlockContent').hide();
					 var index = jQuery.cookie("menuLeft");
					 if (index !== null || index !== undefined){	
					 		var index = jQuery.cookie("menuLeft");
					 		//alert('salvato: '+index);
					 		var panel = jQuery('#menuLeft').find(".BlockContent:eq(" + index + ")"); 
					 		panel.show();
					 }
					 else{
					 	jQuery('#menuLeft .BlockContent:first').show();
					 }
					 jQuery('#menuLeft a').click(function() {
					 	for (i=0; i<10000; i++){}
					 });
					 jQuery('#menuLeft .BlockHeader').click(
								function() {
									var checkElement = jQuery(this).parent().find(".BlockContent:first"); 
									if((checkElement.is('.BlockContent')) && (checkElement.is(':visible'))) {
				 						 return false;
				 					}
				 					if((checkElement.is('.BlockContent')) && (!checkElement.is(':visible'))) {
				 						jQuery('#menuLeft .BlockContent:visible').slideUp('normal');
				 						checkElement.slideDown('normal');
				 						var index = jQuery('#menuLeft .BlockHeader').index(this);
                        				jQuery.cookie("menuLeft", index, {expires: 7, path: '/'}); 
				 						return false;
				 					}
				 	 });
				}
				
				jQuery(document).ready(function() { 
					initMenu();
				});
				//]]>
		</jq:outputScript>

	</ui:define>
	<jq:div id="menuLeft">
		<ui:include src="menu/accordion.xhtml"></ui:include>
		<ui:include src="menu/ajax.xhtml"></ui:include>
		<ui:include src="menu/autocomplete.xhtml"></ui:include>
		<ui:include src="menu/barcode.xhtml"></ui:include>
		<ui:include src="menu/button.xhtml"></ui:include>
		<ui:include src="menu/bookmark.xhtml"></ui:include>
		<ui:include src="menu/calendar.xhtml"></ui:include>
		<ui:include src="menu/carousel.xhtml"></ui:include>
		<ui:include src="menu/colorpicker.xhtml"></ui:include>
		<ui:include src="menu/datepicker.xhtml"></ui:include>
		<ui:include src="menu/dialog.xhtml"></ui:include>
		<ui:include src="menu/draggable.xhtml"></ui:include>
		<ui:include src="menu/droppable.xhtml"></ui:include>
		<ui:include src="menu/effects.xhtml"></ui:include>
		<ui:include src="menu/icons.xhtml"></ui:include>
		<ui:include src="menu/lightbox.xhtml"></ui:include>
		<ui:include src="menu/multiselect.xhtml"></ui:include>
		<ui:include src="menu/panel.xhtml"></ui:include>
		<ui:include src="menu/progressbar.xhtml"></ui:include>
		<ui:include src="menu/quicksearch.xhtml"></ui:include>
		<ui:include src="menu/resizable.xhtml"></ui:include>
		<ui:include src="menu/scriptcollector.xhtml"></ui:include>
		<ui:include src="menu/simplyscroll.xhtml"></ui:include>
		<ui:include src="menu/slider.xhtml"></ui:include>
		<ui:include src="menu/spinner.xhtml"></ui:include>
		<ui:include src="menu/tablesort.xhtml"></ui:include>
		<ui:include src="menu/tooltip.xhtml"></ui:include>
		<ui:include src="menu/watermark.xhtml"></ui:include>
	</jq:div>
</ui:composition>
